<!DOCTYPE html>
<html xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<link href="resources/styles/main.css" rel="stylesheet" type="text/css" />
</h:head>

<f:event type="preRenderView" listener="#{teamViewBean.init}" />

<h:body>
	<p:ajaxStatus onstart="statusDialog.show();"
		onsuccess="statusDialog.hide();" />
	<p:dialog modal="true" widgetVar="statusDialog" header="#{msg.loading}"
		draggable="false" closable="false">
		<p:graphicImage value="/resources/img/ajaxloadingbar.gif" />
	</p:dialog>
	<f:view locale="#{language.localeCode}" />
	<div id="container">
		<div id="header">
			<ui:include src="/query.xhtml">
				<ui:param name="title" value="#{msg.team}" />
				<ui:param name="bean" value="#{teamViewBean}" />
			</ui:include>
		</div>
		<div id="content">
			<h:form id="teamform">

				<p:dataTable var="rec" rowKey="#{rec.name}" paginator="true" rows="5"
					value="#{teamViewBean.teams}"
					selection="#{teamViewBean.selectedTeam}" id="teamTable"
					rowsPerPageTemplate="5,10,15,25,50,100"
					emptyMessage="#{msg.norecordsfound}">

					<f:facet name="header">  
            #{msg.lteam} (#{teamViewBean.length}) 
        </f:facet>
        <p:ajax event="sort"
                            listener="#{teamViewBean.caseListSortListner}" update=":teamform:teamTable" />
					<p:column selectionMode="single" style="width:18px" />
					<p:ajax event="rowSelect"
						listener="#{teamViewBean.onRowSelect}"
						update=":teamform" />
					<p:column headerText="ID" sortBy="#{rec.id}" filterBy="#{rec.id}"
						id="id">  
            #{rec.id}  
        </p:column>
					<p:column headerText="Name" sortBy="#{rec.name}"
						filterBy="#{rec.name}" id="name">  
            #{rec.name}  
        </p:column>
					<p:column headerText="Teamtypeid" sortBy="#{rec.teamtypeid}"
						filterBy="#{rec.teamtypeid}" id="teamtypeid">  
            #{rec.teamtypeid}  
        </p:column>
					<p:column headerText="Rootid" sortBy="#{rec.rootid}"
						filterBy="#{rec.rootid}" id="rootid">  
            #{rec.rootid}  
        </p:column>
        			<p:column headerText="Details" sortBy="#{rec.details}"
						filterBy="#{rec.details}" id="details">  
            #{rec.details}  
        </p:column>
					<p:column headerText="Stateid" sortBy="#{rec.stateid}"
						filterBy="#{rec.stateid}" id="stateid">  
            #{rec.stateid}  
        </p:column>
					<p:column headerText="Modified" sortBy="#{rec.modified}"
						filterBy="#{rec.modified}" id="modified">  
            #{rec.modified}  
        </p:column>
					<p:column headerText="Created" sortBy="#{rec.created}"
						filterBy="#{rec.created}" id="created">  
            #{rec.created}  
        </p:column>
				</p:dataTable>
			</h:form>

		</div>
		<div id="footer">
			<ui:include src="/footer.xhtml" />
		</div>
	</div>
</h:body>
</html>